package com.example.mybatis.demo.service;

import com.example.mybatis.demo.mapper.UserInfoMapper;
import com.example.mybatis.demo.model.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {
    @Autowired
    private UserInfoMapper userInfoMapper;
//    public List<UserInfo> selectUserList(){
//        return userInfoMapper.selectAll();
    public UserInfo queryUserByPassword(String username,String password){
        List<UserInfo> userInfos=userInfoMapper.queryUserByPassword(username,password);
        if(userInfos!=null&&userInfos.size()>0){
            return userInfos.get(0);
        }
        return null;
    }

}
